home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
util
/
misc
/
TOJ_Utils.lha
/
FOR12.LHA
/
For.doc
< prev
next >
Wrap
Text File
|
1994-06-08
|
3KB
|
110 lines
For V. 1.2
© 1993 Antonello Biancalana
ProMIND Software Development
Format: For <variable> IN <set> DO <command>
Template: VAR/A,IN/K,SET/A,DO/K,COMMAND/A
Purpose: Performs a command for a set of files or for a specific number
of times.
Specification: This command sequentially sets the specified variable to
each member of set, and uses the variable to evaluate the command. If a
member of set is an expression involving pattern matching (#?), then the
variable is set to each matching item from the disk or the specified
path. Set can also be an expression of multiple files or suffixes. When
multiple files or suffixes are used in set, they must be enclosed in
parenthesis. Variables' names must always begin with a dollar sign ($).
When the set starts with a % (percent) sign, an integer number must
follow. In this way you can repeat the command for a specific number of
times.
Examples:
For $var in Amiga_is_(fantastic|great|amazing) do echo $var
Amiga_is_fantastic
Amiga_is_great
Amiga_is_amazing
For $x in d#?.c do list $x
dinfo.c 7663 ----rwed 02-Jul-93 12:06:52
1 file - 16 blocks used
DirUsage.c 13634 ----rwed 12-Nov-92 17:02:59
1 file - 28 blocks used
For $v in CSources:d#?.(c|o) do list $v
dinfo.c 7663 ----rwed 02-Jul-93 12:06:52
1 file - 16 blocks used
DirUsage.c 13634 ----rwed 12-Nov-92 17:02:59
1 file - 28 blocks used
dinfo.o 3552 ----rwed 02-Jul-93 12:08:20
1 file - 7 blocks used
DirUsage.o 8674 ----rwed 12-Nov-92 17:05:40
1 file - 17 blocks used
For $q in (DirUsage|dinfo|WSet).c do copy $q ram:
Files DirUsage.c, dinfo.c and WSet.c will be copied in the ram:
For $drive in df(0|1|2): do AddBuffers $drive 32
df0: has 32 buffers
df1: has 32 buffers
df2: has 32 buffers
The variable $drive will be equal to df0:, df1: and df2: then it will be
used as an argument to the command AddBuffers.
This is the same as if you type the following three commands:
AddBuffers df0: 32
AddBuffers df1: 32
AddBuffers df2: 32
For $n in %5 do echo $n
1
2
3
4
5
The command echo is executed five times (%5) and for each issue the
variable $n is set to the current iteration number from 1 to 5.
----
For has been written by:
Antonello Biancalana
ProMIND Software Development
Perugia, ITALY
FIDO: 2:335/412.3
HAMCALL: IK0TOJ
NOTE: This is a shareware program and it can be freely distributed to
anyone. The program MUST be distributed with this documentation file.